<layout name="page" />
<block name="content">
	<style>
		.content-wrap {
			background: #FFF;
			border: 1px solid #ccc;
			padding-left: 8px;
			padding-right: 8px;
			padding-top: 8px;
			padding-bottom: 12px;
			width: 100%;
		}
	</style>
	{:widget('page_header/simple',array('name'=>$vo['name'],'search'=>'N'))}
	<div class="operate-panel">
		<a onclick="go_return_url();" class="btn btn-return">返回</a>
		<if condition="$auth->admin">
			<a class="btn btn-del" onclick="del()">删除</a>
		</if>
		<i class="mid"></i>
		<a onclick="winprint()" class="btn btn-normal m-hidden">打印</a>
		<if condition="($auth->write) and ($vo['user_id']==get_user_id())">
			<i class="split"></i>
			<a onclick="edit();" class="btn btn-normal">修改</a>
		</if>
	</div>
	<div class="row frame">
		<input type="hidden" id="id" name="id" value="{$vo.id}">
		<div class="box col-6">
			<label class="input-label" >文件名：</label>
			<div class="input-box">
				{$vo.name}
			</div>
		</div>
		<div class="box col-6">
			<label class="input-label" >文件编号：</label>
			<div class="input-box">
				{$vo.doc_no}
			</div>
		</div>
		<div class="box col-6">
			<label class="input-label" >登录人：</label>
			<div class="input-box">
				{$vo.user_name}
			</div>
		</div>
		<div class="box col-6">
			<label class="input-label" >登录日期：</label>
			<div class="input-box">
				{:date('Y-m-d H:i',$vo['create_time'])}				
			</div>
		</div>
		<div class="box col-12 newline">
			<label class="input-label" >内容：</label>
			<div class="content-wrap">
				{$vo.content}
			</div>
		</div>
		<div class="box col-12 newline">
			<label class="input-label" for="name">附件：</label>
			{:widget('file_upload/view',array('add_file'=>$vo['add_file'],'mode'=>'show'))}
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use('global', function() {
			var $ = layui.jquery;
			var fn = {
				del : function() {
					layer.msg('确定要删除吗?', {
						time : 0,
						btn : ['确定', '取消'],
						yes : function() {
							send_ajax("{:url('del')}", 'id=' + $("#id").val(), function(ret) {
								if (ret.status) {
									layer.msg(ret.info, {
										time : 1200
									}, function() {
										go_return_url();
									});
								} else {
									layer.msg(ret.info);
								}
							});
						},
						no : function(index) {
							layer.close(index);
						}
					});
				},
				edit : function() {
					window.open("{:url('edit',array('id'=>$vo['id']))})", "_self");
				}
			};
			win_exp(fn);
		});
	</script>
</block>